import { useIntl } from 'umi'

let intl: any = null;
function init_intl() {
    if (intl) {
        return intl
    } else {
        intl = useIntl()
        return intl
    }
}
const langIntl: React.FC<{
    id: string;
    defaultMessage: string;
}> = (props) => {
    let it = init_intl();
    console.log(it);
    
    return it.formatMessage({
        id: props.id,
        defaultMessage: props.defaultMessage,
    })
}
export default langIntl;